package edu.sctu.xialei.May.day20150517three;

/**
 * Created by Administrator on 2015/5/17 0017.
 */
public class TextOne extends TextMore {

    public  void getTercherInfo(int sort_Number[],TeaCher teaChers[]){

        System.out.print("*****排序后按老师 工号 顺序输出*****\n");

        for (int i = 0; i < sort_Number.length; i++) {

            for (int j = 0; j < teaChers.length; j++) {
                if(sort_Number[i] == teaChers[j].number){
                    System.out.print("\n"+ teaChers[j].name  + "  " + teaChers[j].number + "  " + teaChers[j].title + "  " +
                                     teaChers[j].course + "  " + teaChers[j].sex);

                    System.out.print("        教的学生：");
                    for (int k = 0; k < teaChers[j].students.length; k++) {
                        System.out.print(teaChers[j].students[k]+" ");
                    }
                }
            }
        }

    }

    public void getStudent(int code,Student []all_Students){

        System.out.println("\n\n\n*****大于 " + code + " 分的学生有*****");

        for (int i = 0; i < all_Students.length; i++) {
            if(code < all_Students[i].grade){
                System.out.println(all_Students[i].name);
            }
        }

    }



    JudgeBhevacode judge_bhevacode = new JudgeBhevacode() {
        @Override
        public void judge(TeaCher[] teachers,int code,Student[] students) {

            for (int i = 0; i < teachers.length; i++) {

                for (int j = 0; j < teachers[i].students.length; j++) {

                    for (int k = 0; k < students.length; k++) {

                        if (teachers[i].students[j].equals( students[k])){
                            if (students[k].grade > code){
                                System.out.println(students[k].name);
                            }

                        }
                    }
                }

            }

        }
    };

    public void getCode(Student[]students,TeaCher[]teaChers,int code,JudgeBhevacode judge_bhevacode){

    }
}

        




